package com.lee9213.demo.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;

import com.lee9213.core.annotation.DataSource;
import com.lee9213.core.exception.MapperException;
import com.lee9213.demo.entity.DemoEntity;

/**
 * @author libo
 * @version 1.0
 * @date 2017/11/28 9:57
 */
@Mapper
public interface IDemoMapper {

    /**
     * 添加对象
     *
     * @param entity
     * @return 主键ID
     */
    Long save(DemoEntity entity) throws MapperException;

    /**
     * 修改对象
     *
     * @param entity
     * @return
     */
    Integer update(DemoEntity entity) throws MapperException;

    @DataSource(slave = true)
    List<DemoEntity> list() throws MapperException;
}
